#ifndef PCBBOARD_WASHINGMACHINE_H
#define PCBBOARD_WASHINGMACHINE_H

#include "Motor.h"
#include "Pump.h"
#include "Door.h"
#include "Soap_Tray.h"
#include "Menu.h"
#include "Valve.h"
#include "Tub.h"
#include "Menu.h"


namespace washer
{
	
	typedef enum selection_type
	{
		wash = 1, 
		rinse = 2,
		spin = 3
	}selection_type;


	class PCB_Board
	{
	public:
				
		PCB_Board& operator=(const PCB_Board& p);
		PCB_Board(const PCB_Board& new_board);
		static PCB_Board* Instance(Door*, Motor*, Pump*, Soap_Tray*, Tub*, Valve*, Valve*, Menu*);
		PCB_Board(Door*, Motor*, Pump*, Soap_Tray*, Tub*, Valve*, Valve*, Menu*);
		virtual ~PCB_Board(void);
		void main_loop();

		double sense_water();
		double get_timeleft() const;
		void wash();
		void rinse();
		void spin();
		bool power_motor(Motor& m, bool power_on, double amps);
		bool power_pump(Pump& p, bool power_on);
		bool lock_door(Door& d, bool lock);
		bool dispense_soap(Soap_Tray& st, bool dispense);
		void drain();
		void fill_tub();
		
		void selection(enum user_select);

		void display_error();
	private:
		PCB_Board();
		static PCB_Board* pcb_instance;
		double time_left;
		double water_level;
		long serial_number;

		
		Door* d;
		Motor* m;
		Pump* p;
		Soap_Tray* st;
		Tub* t;
		Valve* v_hot;
		Valve* v_cold;
		Menu* mu;
			
	};

}

#endif